package lab02.test11;

public class Square extends Rectangle{
    private int length;

    public double Midkength(){
        return Math.sqrt(length*length+length*length);
    }

    @Override
    public double Area() {
        return length*length;
    }
    public double primeret(){
        return length*4;
    }

    @Override
    public void printMyWay() {
        System.out.println("边长："+length+"\n"+"面积："+Area()+"\n"+"周长："+primeret()+"\n"+"对角线长："+Midkength());
    }
    Square(){}
    Square(int length){
        this.length = length;
    }

    public int getLength() {
        return length;
    }

    public void setLength(int length) {
        this.length = length;
    }
}
